import { View, Text } from '@tarojs/components'
import React from 'react'
import CImage from '../CImage/index'
import './index.scss'
interface IComment {
  data: {
    avatarUrl: string
    nickName: string
    gmtCreate: Date
    comment: string
  }
}

export default function CComment(data: IComment) {
  const { avatarUrl = '', nickName = '', gmtCreate = '', comment = '' } = data.data
  return (
    <View className='commentItem'>
      <View className='authorImg'>
        <CImage src={avatarUrl} circle></CImage>
      </View>
      <View className='commentRight'>
        <View className='commentTop'>
          <Text className='nickName'>{nickName}</Text>
          <Text className='commentDate'>{gmtCreate}</Text>
        </View>
        <View className='commentContent'>{comment}</View>
      </View>
    </View>
  )
}
